import L_Math from "../utils/L_Math";



/**
 * id转换的缓存 避免反复计算
 */
const IdRelMap:any={}


export function ID2ICache(str:string):number{
    let rs:number=IdRelMap[str];
    if(rs==null){
        rs=L_Math.ID2I(str);
        IdRelMap[str]=rs;
    }
    return rs;
}

export function I2IDCache(i:number):string{
    let rs:string=IdRelMap[i];
    if(rs==null){
        rs=L_Math.I2ID(i);
        IdRelMap[i]=rs;
    }
    return rs;
}
